package com.imc.dao.impl;

import java.util.List;

import com.imc.dao.RoleDao;
import com.imc.domain.Role;
import com.imc.persistence.CustomHibernateDaoSupport;


public class RoleDaoImpl extends CustomHibernateDaoSupport implements RoleDao {


	public void delete(Role role) {
		getHibernateTemplate().delete(role);
		
	}

	@SuppressWarnings("unchecked")

	public Role findByRoleId(long roleId) {
		List<Role> list =(List<Role>) getHibernateTemplate().find(
                "from Roles where stockCode=?",roleId
           );
	return (Role)list.get(0);
	}


	public void save(Role role) {
		getHibernateTemplate().save(role);
		
	}


	public void update(Role role) {
		getHibernateTemplate().update(role);
		
	}

}
